<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>下拉菜单</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
            list-style: none;
        }

        .f {
            float: left;
            margin-left: 10px;
            background-color: rgb(182, 205, 206);
            font-size: 20px;
            margin-top: 10px;
        }

        .s {
            display: none;
        }

        .f>li:hover+.s {
            display: block;
        }
    </style>
</head>

<body>
    <div>
        
        <ul class="f">
            <li class="fli">水果</li>
            <ul class="s">
                <li>西瓜</li>
                <li>橘子</li>
                <li>苹果</li>
            </ul>
        </ul>
        <ul class="f">
            <li class="fli">蔬菜</li>
            <ul class="s">
                <li>番茄</li>
                <li>土豆</li>
                <li>豆角</li>
            </ul>
        </ul>
    </div>
</body>

</html>